﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta name="viewport" content=" initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <link rel="apple-touch-icon" sizes="57x57" href="../pwa/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="../pwa/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="../pwa/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="../pwa/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="../pwa/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="../pwa/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="../pwa/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="../pwa/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="../pwa/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192" href="../pwa/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="../pwa/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="../pwa/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="../pwa/favicon-16x16.png">
    <link rel="manifest" href="../pwa/manifest.json">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="../pwa/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">
    <link href="../css/tck.css" rel="stylesheet" />
    <link href="../css/all.css" rel="stylesheet" />
    <script src="../js/android.js"></script>
    <script src="../js/jquery-1.8.0.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/JssDB-1.1.min.js"></script>
    <script src="../js/sha1.js"></script>
    <script src="../js/totp.js"></script>
    <script src="../js/jsonp.js"></script>
    <script src="../js/DateFormat.js"></script>
    <script src="../js/CryptoJSv3.1.2/aes.js"></script>
    <script src="../js/CryptoJSv3.1.2/mode-ecb-min.js"></script>
    <script src="../js/CryptoJSv3.1.2/main.js"></script>
    <script src="../js/patternLock/patternLock.js"></script>
    <script src="../js/db/db.js"></script>
    <script src="../js/db/DbAc.js"></script>
    <script src="../js/db/DbConn.js"></script>
    <script src="../js/db/DbGroup.js"></script>
    <script src="../js/db/DbPwd.js"></script>
    <script src="../js/ui/ui.js"></script>
    <script src="../mk/login.js"></script>
    <script src="../mk/initmainkey.js"></script>
    <script src="../mk/main.js"></script>
    <script src="../mk/mainSync.js"></script>
    <script src="../mk/ac.js"></script>
    <script src="../mk/acAdd.js"></script>
    <script src="../mk/randomPwd.js"></script>
    <script src="../mk/acEdit.js"></script>
    <script src="../mk/acShow.js"></script>
    <script src="../mk/pwdEdit.js"></script>
    <script src="../mk/pwdHis.js"></script>
    <script src="../mk/serverSet.js"></script>
    <script src="../mk/connLst.js"></script>
    <script src="../mk/connEdit.js"></script>
    <script src="../js/jsBridge.js"></script>
    <script src="../js/interface.js"></script>
    <script src="../js/mk.js"></script>
    <script src="../js/htmlcache.js"></script>
    <script src="../js/sysState.js"></script>
    <script>
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)
                return unescape(r[2]);
            return null;
        }
        function mainInit() {
            var mainKey = SysState.mainKey.get();
            if (!mainKey) {
                loadPage('initmainkey', {
                    onSeted: mainInit
                });
                return;
            }
            if (!SysState.loginKey) {
                loadPage('login', {
                    'onDraw': function (key, pwd2) {
                        var mk = SysState.mainKey.get(key + pwd2);
                        if (!mk) {
                            mAlert('解锁密码错误', mainInit);
                            thePatternLockObj.reset();
                            SysState.ljcw.check();
                        } else {
                            SysState.ljcw.reset();
                            SysState.loginKey = key;
                            SysState.pwd2 = pwd2;
                            mainInit();
                        }
                    }
                });
                return;
            }
            loadPage('main');
        }
        $(function () {
            initJsBridge();
            SysState.IKey = GetQueryString('IKey');
            SysState.NotShowPwd = GetQueryString('NotShowPwd');
            SysState.NotPWA = GetQueryString('NotPWA') == 1;
            SysState.IsSupportFingerprint = GetQueryString('IsSupportFingerprint');
            if (!SysState.IKey && typeof (_theIkey) != 'undefined') {
                SysState.IKey = _theIkey;
                SysState.NotShowPwd = _NotShowPwd;
                SysState.IsSupportFingerprint = _IsSupportFingerprint;
            }
            mainInit();
        });
    </script>
    <script type="text/javascript">
        if (!GetQueryString('NotPWA')) {
            if ('serviceWorker' in navigator) {
                window.addEventListener('load', function () {
                    navigator.serviceWorker.register('./serviceWorker.js', { scope: './' })
                        .then(function (registration) {
                            console.log('ServiceWorker registration successful with scope: ', registration.scope);
                        })
                        .catch(function (err) {
                            console.log('ServiceWorker registration failed: ', err);
                        });
                });
            }
            history.pushState(null, null, document.URL);
            window.addEventListener('popstate', function () {
                if (IFGoBack(SysState.IKey)) {
                    history.pushState(null, null, document.URL);
                } else {
                    history.back();
                }
            });
            document.addEventListener('visibilitychange', function () {
                if (document.visibilityState === 'hidden') {
                    IFLock(SysState.IKey);
                }
                console.log(document.visibilityState);
            });
        }
    </script>
</head>
<body>
    <audio src='../sound/kr.ogg' style='display:none' id='clickSound'></audio>
    <div id="sstckzzc"></div>
    <div id="sstckzzc2"></div>
    <img id="sstckdddh" src="../images/wait.gif" style="display:none" />
    <div id="sstck" style="display:none">
        <div id="sstcktt"></div>
        <div id="sstckbody">
            <input id="gjz" type="search" name="" value="" />
            <span id="tcxxtx"></span>
            <ul id="tcxzk"></ul>
        </div>
        <div id="sstckbtn">
            <div>
                <div id="sqd">
                    确定
                </div>
                <div id="sqx">
                    取消
                </div>
            </div>
        </div>
    </div>
    <div id="mk_body">
    </div>
</body>
</html>
